package com.baizhi.zjs.entity;

import java.io.Serializable;

public class ShopingCat implements Serializable{
//购物车项表
	private Integer count; //数量
	private Integer state; //状态
	private BookEntity book;//图书对象
	private Double subtotal;//小计
	private Double subtotaldd;//小计
	
	public ShopingCat() {
		super();
	}

	public ShopingCat(Integer count, Integer state, BookEntity book,
			Double subtotal, Double subtotaldd) {
		super();
		this.count = count;
		this.state = state;
		this.book = book;
		this.subtotal = subtotal;
		this.subtotaldd = subtotaldd;
	}
//方法计算原价的小计
	public Double  getYuan(){
		return getCount() * book.getPrice();
	}
	////方法计算当当价的小计
	public Double getDd(){
		return getCount() * book.getDdprice();
	}
	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public BookEntity getBook() {
		return book;
	}

	public void setBook(BookEntity book) {
		this.book = book;
	}

	public Double getSubtotal() {
		return subtotal;
	}

	public void setSubtotal(Double subtotal) {
		this.subtotal = subtotal;
	}

	public Double getSubtotaldd() {
		return subtotaldd;
	}

	public void setSubtotaldd(Double subtotaldd) {
		this.subtotaldd = subtotaldd;
	}

	@Override
	public String toString() {
		return "ShopingCat [count=" + count + ", state=" + state + ", book="
				+ book + ", subtotal=" + subtotal + ", subtotaldd="
				+ subtotaldd + "]";
	}
	
}
